package com.example.PriceCompare;

import java.io.IOException;
import java.util.List;

import android.content.Context;
import android.location.Address;
import android.location.Geocoder;
import android.location.LocationListener;
import android.location.LocationManager;
import android.util.Log;
import android.view.LayoutInflater;
import android.widget.ImageButton;
import android.widget.RelativeLayout;
import android.widget.TextView;

public class ItemView extends RelativeLayout{

	private TextView itemDetails ;
	private TextView itemStore, itemPrice, itemStoreDist;
	private ImageButton Call;
   
	
	public ItemView(Context context , String ProductName, String StoreName, int Price, double distance) {
		super(context);
		// TODO Auto-generated constructor stub
		LayoutInflater inflater = (LayoutInflater)context.getSystemService(
				Context.LAYOUT_INFLATER_SERVICE);

		inflater.inflate(R.layout.itemview, this ,true);
		
		itemDetails = (TextView) findViewById(R.id.ProductInfo);
		itemStore = (TextView) findViewById(R.id.StoreAddress);
		itemPrice = (TextView) findViewById(R.id.ProductPrice);
		itemStoreDist = (TextView) findViewById(R.id.StoreDistance);
		Call = (ImageButton) findViewById(R.id.callButton);
//		Call.setBackgroundResource(R.color.Transparent);
		itemDetails.setText(ProductName);
		itemStore.setText(StoreName);
		itemPrice.setText("Rs. "+Integer.toString(Price));
		itemStoreDist.setText(Double.toString(distance) +"km");
	}
	
	public void setProductName(String ProductName){
		itemDetails.setText(ProductName);
	}
	
	public void setProductPrice(int Price){
		itemPrice.setText("Rs. "+Integer.toString(Price));
	}
	
	public void setStoreDistance(double distance){
		itemStoreDist.setText(Double.toString(distance)+"km");
	}
	
	public void setStoreAddress(String StoreName){
		itemStore.setText(StoreName);
	}

	
}
